﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
using UnityEngine.SceneManagement;

public class StartOnClick : MonoBehaviour
{
    AsyncOperation asyn;
    void Start()
    {
        transform.DOLocalMoveY(0, 1.0F);
    }

    void Update()
    {
        if (asyn!= null)
        {
            Debug.Log(asyn.progress);
            transform.FindChild("Slider").gameObject.SetActive(true);
            transform.FindChild("Slider").GetComponent<Slider>().value = asyn.progress * 100;
        }
    }

    public void OnClick()
    {
        asyn = SceneManager.LoadSceneAsync("MainScene");
    }
}
